package top.codedance.iotp.client.net.configuration;


import top.codedance.iotp.client.net.handler.Controller;
import top.codedance.iotp.client.net.handler.action.OprationController;
import top.codedance.iotp.common.constent.Command;

import java.util.HashMap;
import java.util.Map;

public class HttpRouteConfig {
    private static final String CONTENT_PATH = "/rest/api";

    public static Map<String, Controller> getConfig(){
        HashMap<String, Controller> routeConfig = new HashMap<>();
        routeConfig.put(CONTENT_PATH + "/client/plugins/params/set", new OprationController(Command.CLIENT_PLUGINS_PARAMS_SET));
        routeConfig.put(CONTENT_PATH + "/client/plugins/params/get", new OprationController(Command.CLIENT_PLUGINS_PARAMS_GET));
        routeConfig.put(CONTENT_PATH + "/client/boot/params/set", new OprationController(Command.CLIENT_PLUGINS_PARAMS_SET));
        routeConfig.put(CONTENT_PATH + "/client/boot/params/get", new OprationController(Command.CLIENT_PLUGINS_PARAMS_GET));
        routeConfig.put(CONTENT_PATH + "/client/generic/db/query", new OprationController(Command.GENERICDB_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/mysql/query", new OprationController(Command.MYSQL_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/control/query", new OprationController(Command.MYSQL_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/mssql/query", new OprationController(Command.MSSQL_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/oracle/query", new OprationController(Command.ORACLE_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/com/command", new OprationController(Command.COM_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/udp/command", new OprationController(Command.UDP_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/opc/command", new OprationController(Command.OPC_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/can/command", new OprationController(Command.CAN_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/dnp/command", new OprationController(Command.DNP_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/bacnet/command", new OprationController(Command.BACNET_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/iec/command", new OprationController(Command.IEC_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/mtconnect/command", new OprationController(Command.MTCONNECT_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/profibus/command", new OprationController(Command.PROFIBUS_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/profinet/command", new OprationController(Command.PROFINET_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/modbus/command", new OprationController(Command.MODBUS_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/system/command", new OprationController(Command.SYSTEM_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/http/command", new OprationController(Command.HTTP_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/pushData/get", new OprationController(Command.PUSH_DATA_COMMAND));
        routeConfig.put(CONTENT_PATH + "/client/shutdown", new OprationController(Command.SHUTDOWN));
        routeConfig.put(CONTENT_PATH + "/client/view/version", new OprationController(Command.VIEW_CLIENT_VERSION));
        routeConfig.put(CONTENT_PATH + "/client/view/infomation", new OprationController(Command.NONE));
        return routeConfig;
    }
}
